FROM swr.cn-north-4.myhuaweicloud.com/swr-devadv/cangjie:0.53.18-0
WORKDIR /app

# 设置环境变量
ENV CANGJIE_HOME="/root/cangjie"
ENV PATH="/root/cangjie/bin:/root/cangjie/tools/bin:/root/.cjpm/bin:$PATH"
ENV LD_LIBRARY_PATH="/root/cangjie/runtime/lib/linux_x86_64_llvm:/root/cangjie/tools/lib"

# 复制项目文件到容器中
COPY . .

# 更新依赖并构建项目
RUN cjpm update
RUN cjpm build

# 设置入口点，使容器启动时可以接收参数并运行程序
ENTRYPOINT ["cjpm", "test"]